diff --git a/BUILD.bazel b/BUILD.bazel
index 4ac8f10..632800a 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -198,12 +198,18 @@ cc_library(
 
 config_setting(
     name = "linux_x86_64",
-    values = {"cpu": "k8"},
+    constraint_values = [
+        "@platforms//cpu:x86_64",
+        "@platforms//os:linux",
+    ],
 )
 
 config_setting(
     name = "linux_arm",
-    values = {"cpu": "arm"},
+    constraint_values = [
+        "@platforms//cpu:arm",
+        "@platforms//os:linux",
+    ],
 )
 
 config_setting(
@@ -223,7 +229,10 @@ config_setting(
 
 config_setting(
     name = "linux_aarch64",
-    values = {"cpu": "aarch64"},
+    constraint_values = [
+        "@platforms//cpu:aarch64",
+        "@platforms//os:linux",
+    ],
 )
 
 config_setting(
